package com.cby.jetpack.sample.binding

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.cby.jetpack.sample.R
import com.cby.jetpack.sample.binding.data.ImageInfo
import com.cby.jetpack.sample.databinding.ActivityDataBindAdapterBinding
import com.cby.jetpack.sample.ext.dataBinding

/**
 * @description: TestDataBindingAdapterActivity
 *
 * @author ChenBaoyang
 * @date 8/10/21 10:22
 */
class TestDataBindingAdapterActivity :  AppCompatActivity() {

    private val url = "https://ae01.alicdn.com/kf/U76a18e0d315e407a8daf3d91de033e31i.jpg"

    private val binding: ActivityDataBindAdapterBinding by dataBinding(R.layout.activity_data_bind_adapter)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val image = ImageInfo("美女图片", url)
        binding.imageInfo = image
    }
}